package com.projrct;

import javax.swing.*;
import java.io.FileReader;
import java.util.Properties;

public class ClassTest {
    public static void main(String[] args) {
        String item = JOptionPane.showInputDialog(null,"选择语言：1-中文\n2-English");

        //创建属性文件对象
        Properties plus = new Properties();
        try {
            if ("1".equals(item)){
                plus.load(new FileReader("Class8_24/src/demo.txt"));
            }
            if ("2".equals(item)){
                plus.load(new FileReader("Class8_24/src/demo1.txt"));
            }
        }catch (Exception e){
            System.out.println("文件不存在");
        }
        String res = plus.getProperty("two");
        int a = Integer.parseInt(JOptionPane.showInputDialog(null,plus.getProperty("one")));
        JOptionPane.showMessageDialog(null,res+a*a);
    }
}
